home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / mac / hypercrd / hc2_x / tcprogud.sit / TC Prog Guide / card_42427.txt < prev    next >
Text File  |  1991-02-27  |  2KB  |  39 lines

  1. -- card: 42427 from stack: in
  2. -- bmap block id: 0
  3. -- flags: 0000
  4. -- background id: 4755
  5. -- name: 
  6.  
  7.  
  8. -- part contents for background part 6
  9. ----- text -----
  10. 4.4  Example
  11.  
  12. -- part contents for background part 4
  13. ----- text -----
  14. The following pages contain source code for a complete example demonstrating the use of TC/C++ object-oriented programming techniques.  Each page contains a scrolling text field whose contents may be pasted into an individual source or header file for compilation.  These text fields contain both TC and C++ versions, where different.  In practice, conditional compilation* may be used to create programs which compile properly under both TC and C++ without modification.
  15.  
  16. As mentioned earlier, it is useful to place the declaration for each class in a separate header file (indicated by the extension '.h' in the file name) which may be accessed from the appropriate source files (indicated by the '.c' extension) using the #include preprocessor directive**.  (Chapter 7 also discusses #define and the #ifndef directive used by C++ to prevent multiple references to the same header file.)  For each class, the method definitions are usually contained in a separate source file.  Finally, the        'main.c' source file contains the main() function where execution of the program begins.
  17.  
  18.  
  19. -- part contents for background part 7
  20. ----- text -----
  21. 130
  22.  
  23. -- part contents for background part 29
  24. ----- text -----
  25. 55726
  26. 52189
  27.  
  28. -- part contents for background part 27
  29. ----- text -----
  30. TC/C++ portability
  31. File inclusion
  32.  
  33. -- part contents for background part 20
  34. ----- text -----
  35. TC/C++ portability - p183
  36.  
  37. -- part contents for background part 23
  38. ----- text -----
  39. File inclusion - p175